package com.neuq.animaladoption.validation;

import com.neuq.animaladoption.anno.UserIdentity;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

public class UserIdentityValidation implements ConstraintValidator<UserIdentity,String> {
    @Override
    public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) {
        if(s==null){
            return false;
        }
        if(s.equals("管理员")||s.equals("收容所")||s.equals("用户")){
            return true;
        }
        return false;
    }
}
